<template>
  <el-input
    type="textarea"
    v-model="showData"
    placeholder="在这里输入多行文本"
    :rows="6"
    readonly
    clearable
  />
  <span>{{ receivedText }}</span>
</template>

<script lang="ts" setup>
import { ref, onMounted, onUnmounted } from "vue";
import emitter from "../../utils/eventBus";
import { storage } from "./localStorge";
const showData = ref("这是w4初始显示数据");
const receivedText = ref("abc");
// const getMitt = (e) => {
//     console.log("接收到来自w1的参数", e)
//     showData.value = e.id
//     receivedText.value = e.id
// }
//接收来自w1的参数
onMounted(() => {
  // emitter.on("send", getMitt)
  const userData = storage.get("userId");
  console.log("userData", userData);
  showData.value = userData;
  receivedText.value = userData;
});
//释放
onUnmounted(() => {
  // emitter.off("send", getMitt)
});
</script>
